<template>
	<view>
		<view class="uni-padding-wrap">
			<uni-section title="评价此次工单" type="line" padding>
				<uni-rate v-model="pjobj.rate" @change="onChange" />
				<uniEditor @onStatusChange="getStatusChange"></uniEditor>
			</uni-section>
		</view>
	</view>
</template>
<script>
	//import uniEditor from '@/components/uni-editor/editor.vue'
	import uniEditor from '@/pages_bd/uni-editor/editor.vue'
	import UniRate from '@/pages_bd/components/uni-rate/uni-rate'
	var _this;
	var vk = uni.vk;
	export default {
		components: {uniEditor,UniRate},
		data() {
			// 页面数据变量
			return {
				options:{},
				pjobj:{
					rate:5
				}
			}
		},
		// 监听 - 页面每次【加载时】执行(如：前进) await
		async onLoad(options = {}) {
			_this = this;
			vk = uni.vk;
			this.options = options;
			this.init(options);
		},
		// 监听 - 页面【首次渲染完成时】执行。注意如果渲染速度快，会在页面进入动画完成前触发
		onReady(){
			
		},
		// 监听 - 页面每次【显示时】执行(如：前进和返回) (页面每次出现在屏幕上都触发，包括从下级页面点返回露出当前页面)
		onShow() {
			
		},
		// 监听 - 页面每次【隐藏时】执行(如：返回)
		onHide() {
			
		},
		// 监听 - 点击右上角转发时
		onShareAppMessage(options) {
			
		},
		// 函数
		methods: {
			getStatusChange(e){
				vk.callFunction({
				  url: 'client/gsxy/xybx/pub/xybxapi.updateWxryWzListOne2',
				  title: '请求中...',
				  data: {
				    _id:_this.options.itemid,
					pjdata:e,
					rate:_this.pjobj.rate
				  },
				  success: (data) => {
				    //console.log(data)
					vk.redirectTo('/pages_bd/xybx/xybxsygdjd');
				  }
				});
			},
			onChange(e){
				_this.pjobj.rate = e.value
				//console.log(_this.pjobj.rate)
			},
			// 页面数据初始化函数
			init(options){
				//vk.reLaunch("/pages_template/uni-id/index/index");
			},
			pageTo(path){
				vk.navigateTo(path);
			}
		},
		// 监听器
		watch:{
			
		},
		// 计算属性
		computed:{
			
		}
	}
</script>
<style lang="scss" scoped>
	
	
</style>